<link rel="stylesheet" type="text/css" href="css/aliceui.min.css"/>
<link rel="stylesheet" type="text/css" href="css/c_common.css"/>
<link rel="stylesheet" type="text/css" href="js/dataTable/jquery.dataTables.min.css">
<link type="text/css" rel="stylesheet" href="js/dataTable/prod_sale.css" />
<script type="text/javascript" charset="utf8" src="js/dataTable/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="js/dataTable/prod_sale.js"></script>
<style>
/* 表格部分*/
.list{border:1px solid #CFCFCF;background-color:#FFFFFF;margin-top:40px;line-height:35px;position:relative;cursor:pointer;}
.list_top{width:35%;height:35px;}
.top_left{width:35%;}
.title {color:#2380ac;font-size:14px;padding-left:20px;margin-right:20px;}
.level{width:100px;height:31px;background-color:#FFF9E9;border-radius:16px;-moz-border-radius:16px;position:absolute;right:2px;top:2px;line-height:31px;padding-left:15px;}
.level .downward{display:block;width:21px;height:21px;background-color:#F48239;border-radius:16px;-moz-border-radius:16px;position:absolute;top:5px;right:-10px;}
.level em {display: inline-block;width: 0;height: 0;vertical-align: middle;border: 5px solid #F48239;border-bottom-width: 0; border-top-color: #FFFFFF;margin-top:-14px;margin-left:-2px;}
.select{width:50px;height:30px;position:absolute;top:0;left:50px;cursor:pointer;text-align:center;z-index:999999;}
.select_txt{display:block;line-height:31px;}
.select:hover em {border: 5px solid #F48239;border-top-width: 0;border-bottom-color: #FFFFFF;}
.select_list {background-color:#FFFFFF;;border: 1px solid #cccccc;display:none;margin-left:-25px;}
.select_list li{line-height:40px;}
.select_list li.current{background-color:#F2F2F2;}
.select_list li:hover {background-color: #E0E0E0;}
.top_right{width:65%;position:absolute;right:-1px;top:0;border-left:1px solid #CFCFCF;background-color:#F3F3F3;color:#9C9DA1;}
.list_con{position:relative;}
.ticket{position:absolute;display:block;width:100%;border-top:1px solid #CFCFCF;}
.list_data li{height:50px;line-height:50px;width:65%;margin-top:0;border-top:1px solid #CFCFCF;border-left:1px solid #CFCFCF;margin-left:35%;position:relative;}
.right_head{height:35px;border-bottom:1px solid #CFCFCF;}
.supplier{display:inline-block;width:35%;padding-left:15px;}
.supply_price,.retail_price{display:inline-block;width:14%;text-align:center;}
.operate{display:inline-block;width:30%;text-align:center;}
.operate_a{display:inline-block;width:15%;text-align:center;}
.operate_b{display:inline-block;width:15%;text-align:center;}
.color_a{color:#2380AC;}
.color_b{color:#D8D8D8;}
.click_choose{width:60px;height:25px;background-color:#35BA3B;border-radius:20px;-moz-border-radius:20px;position:absolute;right:15px;top:14px;-webkit-tap-highlight-color: transparent;-webkit-touch-callout: none;-webkit-user-select: none;}
.click_choose span{line-height:25px;position:absolute;left:6px;top:0;color:#35BA3B;}
.round{width:18px;height:18px;background-color:#FFFFFF;border-radius:20px;-moz-border-radius:20px;position:absolute;left:25px;top:3px;}
.on{width:18px;height:18px;background-color:#FFFFFF;border-radius:20px;-moz-border-radius:20px;position:absolute;left:-7px;top:3px;}
.operate_open{color:#FFFFFF;}
</style>
<script>
		$(document).ready(function(){
			$(".level").hover(function(){
			$(this).find(".select_list").show();
			//var selecth=$(".select_list").height();
			//selecth=selecth+48;
			//$(".container_e").css("height",selecth); 
			},function(){
				$(this).find(".select_list").hide();
			});
			$(".select_list li").click(function(){
				var curTxt = $(this).text();
				$(this).addClass("current").siblings().removeClass("current");
				$(this).parent().siblings(".select_txt").text(curTxt);			
				$(this).parent().hide();
			});
		
			$(".click_choose").toggle(
			 function(){
				$(this).css("background","#BABCB9");
				$(this).find("div").addClass("on");
				$(this).find(".operate_open").css("color","#BABCB9");
				$(this).find(".operate_close").css("color","#FFFFFF");
				$(this).parent().prevAll().css("color","#D8D8D8")
				$(this).parent().prev(".operate_a").hide();
			 },
			 function(){
				$(this).css("background","#35BA3B");
				$(this).find("div").removeClass("on");
				$(this).parent().prevAll().css("color","#000000")
				$(this).parent().prev(".operate_a").show();
				$(this).parent().prev(".operate_a").css("color","#2380AC")
				$(this).find(".operate_open").css("color","#FFFFFF");
				$(this).find(".operate_close").css("color","#35BA3B");
			 }
		);
	});
</script>
<div class="clay">
    <div class="content">
        <h3 class="mc_title">
            <span class="mctit_1 mctit_3"><a href="prodlists.html" class="mctit_2 mctit_4">自供应产品</a></span>
            <span class="mctit_1"><span class="mctit_2">转分销产品</span></span>
        </h3>  
        <div id="prod_sale_tiptext" class="ui-tiptext-container ui-tiptext-container-warning">
            <p class="ui-tiptext">
                您可以将其他供应商分销给您的产品再分销给您的其他分销商。
            </p>
            <p class="ui-tiptext ui-tiptext-warning">
               若同一个产品有多个供应商，请勾选一个供应商保存后再配置价格。
            </p>
			<?if(isset($_SESSION['alliance'])):?>
			<p class="ui-tiptext ui-tiptext-warning">
               若您是联盟账号，无法为每个分销商分配价格，即无法显示“分销价格”按钮
            </p>
			<?endif;?>
        </div>
		
		
		<div class="RW">
        <div class="serhW">
            <div class="con">
                <span class="lt">快速查找</span>
                <select name="" id="provSelect" class="prov"></select>
                <select name="" id="citySelect" class="city"></select>
                <select name="" id="conSelect" class="cond">
                    <option value="1">搜景区</option>
                    <option value="2">搜供应商</option>
                </select>
                <input type="text" name="" value="" id="serhInp" class="serhInp" />
                <input type="button" value="查 找" id="serhBtn" class="serhBtn" />
            </div>
        </div>
        <div class="listWrap">
            <!-- <ul id="titUl" class="titUl clearfix">
                <li class="tcol_1 tcol">产品名称</li><li class="tcol_2 tcol">供应商</li><li class="tcol_3 tcol">关联展示<img class="tip" src="images/other/product_package_new_tipicon.png" alt="" /></li>
            </ul> -->
           <!-- <ul id="mlistUl" class="listUl">
               <li class="loading" style="text-align:center; line-height:1; height:400px;"><p style="color:#aeaeae; font-size:12px; padding-top:300px;">加截数据...</p><img src="images/other/loading_1.gif" alt="" /></li>
            </ul>  -->
		<div class="list" id="mlistUl">
			<div class="list_top position_a ">
				<div class="title">XXXX景区</div>
				<div class="level">			
					<span>推荐级别：<span>
					<div class="select">
						<span class="select_txt">3</span><div class="downward"><em></em></div>					
						<ul class="select_list">
							<li>1</li>
							<li>2</li>	
							<li class="current">3</li>
						</ul>
					</div>
				</div>
				
			</div>
			<div class="top_right">
				<span class="supplier">供应商</span>
				<span class="supply_price">供货价</span>
				<span class="retail_price">零售价</span>
				<span class="operate">操作</span>
			</div>	
			<div class="list_con">
				<div class="ticket"><span class="title">成人票</span>ID:545454545</div>
				<ul class="list_data">
					<li>
						<span class="supplier">郑州市东风路支行</span>
						<span class="supply_price">655</span>
						<span class="retail_price">823</span>
						<span class="operate_a color_a">分销价格</span>
						<span class="operate_b">
							<div class="click_choose">
								<span><em class="operate_open">已开</em><em class="operate_close">已关<em><span>
								<div class="round"></div>
							</div>
						</span>
					</li>
					<li>
						<span class="supplier">郑州市东风路支行</span>
						<span class="supply_price">655</span>
						<span class="retail_price">823</span>
						<span class="operate_a color_a">分销价格</span>
						<span class="operate_b">
							<div class="click_choose">
								<span><em class="operate_open">已开</em><em class="operate_close">已关<em><span>
								<div class="round"></div>
							</div>
						</span>
					</li>
				</ul>
			</div>
			<div class="list_con">
				<div class="ticket"><span class="title">成人票</span>ID:545454545</div>
				<ul class="list_data">
					<li>
						<span class="supplier">郑州市东风路支行</span>
						<span class="supply_price">655</span>
						<span class="retail_price">823</span>
						<span class="operate_a color_a">分销价格</span>
						<span class="operate_b">
							<div class="click_choose">
								<span><em class="operate_open">已开</em><em class="operate_close">已关<em><span>
								<div class="round"></div>
							</div>
						</span>
					</li>
					<li>
						<span class="supplier">郑州市东风路支行</span>
						<span class="supply_price">655</span>
						<span class="retail_price">823</span>
						<span class="operate_a color_a">分销价格</span>
						<span class="operate_b">
							<div class="click_choose">
								<span><em class="operate_open">已开</em><em class="operate_close">已关<em><span>
								<div class="round"></div>
							</div>
						</span>
					</li>
				</ul>
			</div>
		</div> 
            <div class="pagenavW clearfix" id="pagenavW">
                <span class="totalItemSize">共<span class="n" style="font-family:arial;color:#fa6f39;font-size:14px; font-weight:bold; margin:0 3px;"></span>条</span>
                <div class="rt">
                    <div class="d d3">
                        <span class="di">去第 </span><input type="text" class="pageInp" id="" /><span class="cerPageBtn" id="cerPageBtn">确定</span><span class="ye"> 页</span>
                    </div>
                    <div class="d d2">
                        <a href="#" class="prevBtn btn" style="margin-left:10px;">上一页</a><a href="#" class="nextBtn btn">下一页</a>
                    </div>
                    <div class="d d1">
                        <span class="curentpage" style="font-size:12px; font-family:arial; color:#fa6f39"></span>
                        <span style="font-size:12px; font-family:arial; margin:0 2px">/</span>
                        <span class="totalpage"></span>页
                    </div>
                </div>
            </div>
        </div>
        
    </div>
		
		
		
		
		
	<!-- 	
        <iframe src="about:blank" style="height: 0;width: 0;display: none;" id="hideFrame" name="hideFrame" frameborder="0"></iframe>
        <div class="ui-table-container">
            <table id="tbl_evlt" class="ui-table">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th style="width:280px;" >产品名称</th>
                        <th style="width:39px;">供货价</th>
                        <th style="width:39px;">零售价</th>
                        <th>供应商</th>
                        <th>选择</th>
                    </tr>
                </thead>
				<tbody>
                <?foreach($sale_data as $pid=>$lists):?>
                    <?foreach($lists as $list):?>
                    <?//if($list['lvl']>2):continue;?>
           
                    <tr>
                        <td title="账户ID|景区ID|门票ID"><?=$_SESSION['sid']?>|<?=$list['data']['landid']?>|<?=$list['data']['ticket_id']?></td>
                        <td><?=$list['data']['ltitle'].'-'.$list['data']['ttitle']?></td>
                        <td><?=$list['fprice']?></td>
                        <td><?=$list['uprice']?></td>
                        <td data-aid="<?=$list['applyer_id']?>"><?=$dnames[$list['applyer_id']]?></td>
                        <td>
                            <input class="chkOnlyOne" data-pid="<?=$list['data']['pid']?>" data-active="<?=$list['active']?>" type="checkbox"
                                   value="<?=$list['sourceid'].'|'.$list['aids'].'|'.$list['eid'].'|'.$list['sid']?>"
                                   name="evlt_<?=$list['data']['pid']?>"
                                <?if($list['active']==1):?>
                                   checked="checked"/>
								<?if(!isset($_SESSION['alliance'])&&$list['lvl']<3):// 分销价格配置显示开始?>
								<a target="_blank" href="adjusting.html?pid=<?=$list['data']['pid']?>&sid=<?=$list['sid']?>&lvl=<?=$list['lvl']?>&aids=<?=$list['aids']?>">
                                分销价格</a>
								<?endif;// 分销价格配置显示结束?>
                            <?else:?>
                                />
                            <?endif;?> 
                        </td>
                    </tr>
                    <?endforeach;?>
<!--                    <tr>-->
<!--                        <td colspan="6"> &nbsp; </td>-->
<!--                        <td>-->
<!--                            <input type="submit" class="ui-button ui-button-sorange" value="保存">-->
<!--                        </td>-->
<!--                    </tr>
                  
                <?endforeach;?>
				  </tbody>
            </table>-->
<script>
$(document).ready(function() {
    $('#tbl_evlt').dataTable( {
        "oLanguage": {
            "sLengthMenu": "每页显示 _MENU_ 条记录",
            "sZeroRecords": "抱歉， 没有找到",
            "sInfo": "从 _START_ 到 _END_ /共 _TOTAL_ 条数据",
            "sInfoEmpty": "没有数据",
            "sInfoFiltered": "(从 _MAX_ 条数据中检索)",
            "oPaginate": {
                "sFirst": "首页",
                "sPrevious": "前一页",
                "sNext": "后一页",
                "sLast": "尾页"
            },
            "sZeroRecords": "没有检索到数据",
            "sProcessing": "<img src='./loading.gif' />"
        }
    });
});
</script>
        </div> 
    </div>
</div>
<script>
jQuery(document).ready(function($){
    $("table#tbl_evlt").on('click', 'input.chkOnlyOne', function(){
        var tname = $(this).attr('name');
        var data = {
            action : 'ProdEvolute',
            pid : $(this).attr('data-pid'),
            info: $(this).val()
        };

        if($(this).attr('checked')) {
            if(!confirm('您确定要变更该产品的供应商吗？')) {
                return false;  
            }
            data['dtype'] = 1;
            $('input[name="'+tname+'"]').removeAttr('checked');
            $(this).attr('checked','checked');
        }
        else {
            if($(this).attr('data-active')!=1) {
                return false;
            }
            if(!confirm('您确定要取消供应该产品吗？')) {
                return false;
            }
            data['dtype'] = 0;
            //如果不是当前配置项不用提交

        }

        $.post('call/jh_prod.php',data, function(res){
            if(res.status=='ok') {
                alert('操作成功！');
                location.reload();
            } else {
                alert(res.msg);
            }
        },'json');
    });
});
</script>